# -*- encoding: utf-8 -*-
from django.shortcuts import render_to_response, get_list_or_404,\
    get_object_or_404
from django.template.context import RequestContext
from downloads.models import Downloads,Categoria

def listar(request):
    lista_categoria = get_list_or_404(Categoria.objects.all().order_by('titulo'))
    lista_downloads = get_list_or_404(Downloads.objects.all().order_by('titulo'))
    return render_to_response('downloads/listar.html',{'downloads':lista_downloads, 'categorias':lista_categoria},context_instance=RequestContext(request))
